import request from '@/utils/request'
import { requestGet,requestPost } from './request/request'



/**
 * 
 * @returns 获取下拉菜单
 */
export const getMyMenu=(obj:any)=>{
    //     return request({
    //      url: "/api/orgs/getMyMenus",
    //      method: "get",
    //  })
    return requestGet("api/Right/GetMyMenus",obj);
}

/**
 * 
 * @returns 获取所有组织
 */
export const getOrganizations=(obj:any)=>{
    return requestGet("api/Organization/getOrganizations",obj);
}

/**
 * 获取当前组织的用户
 */
export const getCurrOrgUsers=(obj:any)=>{
    return requestGet("api/Organization/getUsersByOrg",obj);
}


/**
 * 添加组织
 */
export const addOrganization=(obj:any)=>{
    return requestPost("api/Organization/addOrganization",obj);
}



/**
 * 
 * @param obj 移除组织用户
 * @returns 
 */
export const deleteOrgs=(obj:any)=>{
    return requestPost("api/Organization/DeleteOrgs",obj);
}


/**
 * 获取组织id获取单个职务
 */
export const getSingleOrganization=(obj:any)=>{
    return requestGet("api/Organization/getSingleOrganization",obj);
}

/**
 * 获取职务列表
 */
export const getZhiwuList=(obj:any)=>{
    return requestGet("api/Organization/getZhiwuList",obj);
}


/**
 * 删除职务
 */
export const deleteZhiwu=(obj:any)=>{
    return requestPost("api/Organization/deleteZhiwu",obj);
}

/**
 * 添加职务
 */
export const addZhiwu=(obj:any)=>{
    return requestPost("api/Organization/addZhiwu",obj);
}

/**
 * 获取单个职务详情
 */
export const getSingleZhiwu=(obj:any)=>{
    return requestGet("api/Organization/getSingleZhiwu",obj);
}

/**
 * 修改职务
 */
export const updateZhiwu=(obj:any)=>{
    return requestPost("api/Organization/updateZhiwu",obj);
}


/**
 * 获取组织架构用户列表
 */
export const getUsers=(obj:any)=>{
    return requestGet("api/User/getUsers",obj);
}


/**
 * 删除用户
 */
export const deleteUsers=(obj:any)=>{
    return requestPost("api/User/deleteUsers",obj);
}

/**
 * 禁用/启用用户
 */
export const banUsers=(obj:any)=>{
    return requestPost("api/User/banUsers",obj);
}

/**
 * 获取单个用户详情
 */
export const getSingleUser=(obj:any)=>{
    return requestGet("api/User/getSingleUser",obj);
}








// export default {
//     getMyMenu:new Promise((resolve,reject)=>{
//         setTimeout(() => {
//            return resolve(request({
//             url: "/orgs/getMyMenus",
//             method: "get",
//         }))
//         }, 1000);
//    })
    
// }